package com.rzl.expense.expense.service.impl;

import java.util.List;
import com.rzl.expense.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzl.expense.expense.mapper.RentAccrualMapper;
import com.rzl.expense.expense.domain.RentAccrual;
import com.rzl.expense.expense.service.IRentAccrualService;

/**
 * 租费计提单Service业务层处理
 * 
 * @author expense
 * @date 2024-11-27
 */
@Service
public class RentAccrualServiceImpl implements IRentAccrualService 
{
    @Autowired
    private RentAccrualMapper rentAccrualMapper;

    /**
     * 查询租费计提单
     * 
     * @param accrualId 租费计提单主键
     * @return 租费计提单
     */
    @Override
    public RentAccrual selectRentAccrualByAccrualId(String accrualId)
    {
        return rentAccrualMapper.selectRentAccrualByAccrualId(accrualId);
    }

    /**
     * 查询租费计提单列表
     * 
     * @param rentAccrual 租费计提单
     * @return 租费计提单
     */
    @Override
    public List<RentAccrual> selectRentAccrualList(RentAccrual rentAccrual)
    {
        return rentAccrualMapper.selectRentAccrualList(rentAccrual);
    }

    /**
     * 新增租费计提单
     * 
     * @param rentAccrual 租费计提单
     * @return 结果
     */
    @Override
    public int insertRentAccrual(RentAccrual rentAccrual)
    {
        rentAccrual.setCreateTime(DateUtils.getNowDate());
        return rentAccrualMapper.insertRentAccrual(rentAccrual);
    }

    /**
     * 修改租费计提单
     * 
     * @param rentAccrual 租费计提单
     * @return 结果
     */
    @Override
    public int updateRentAccrual(RentAccrual rentAccrual)
    {
        rentAccrual.setUpdateTime(DateUtils.getNowDate());
        return rentAccrualMapper.updateRentAccrual(rentAccrual);
    }

    /**
     * 批量删除租费计提单
     * 
     * @param accrualIds 需要删除的租费计提单主键
     * @return 结果
     */
    @Override
    public int deleteRentAccrualByAccrualIds(String[] accrualIds)
    {
        return rentAccrualMapper.deleteRentAccrualByAccrualIds(accrualIds);
    }

    /**
     * 删除租费计提单信息
     * 
     * @param accrualId 租费计提单主键
     * @return 结果
     */
    @Override
    public int deleteRentAccrualByDate(String yearMonth)
    {
        return rentAccrualMapper.deleteRentAccrualByDate(yearMonth);
    }




    @Override
    public void batchRentAccrual(List<RentAccrual> list)
    {

         rentAccrualMapper.batchRentAccrual(list);
    }


}
